package com.jzo2o.customer.controller.worker;

import com.jzo2o.common.utils.UserContext;
import com.jzo2o.customer.model.dto.request.WorkerCertificationAuditAddReqDTO;
import com.jzo2o.customer.model.dto.response.RejectReasonResDTO;
import com.jzo2o.customer.service.IWorkerCertificationAuditService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController("workerCertificationController")
@RequestMapping("/worker/worker-certification-audit")
@Api(tags = "服务端 - 服务人员相关接口")
public class WorkerCertificationController {
    @Autowired
    private IWorkerCertificationAuditService workerCertificationAuditService;

    @PostMapping
    public void workerCer(@RequestBody WorkerCertificationAuditAddReqDTO workerCertificationAuditAddReqDTO) {
        workerCertificationAuditAddReqDTO.setServeProviderId(UserContext.currentUserId());
        workerCertificationAuditService.workerCer(workerCertificationAuditAddReqDTO);
    }

    //查询最新的驳回原因
    @GetMapping("/rejectReason")
    public RejectReasonResDTO rejectReason() {
        return workerCertificationAuditService.rejectReason();
    }
}
